To make a semiconductor device with a higher degree of integration, the semiconductor device may use a three-dimensional structure. In the three-dimensional structure, steps may be provided between layers in a contact region to extract individual wires from the layers. There is a method for forming such steps by which to repeatedly perform lithography and etching according to the number of the steps.